package com.javabasic.algorithm.leetcode;

import java.util.List;

/**
 * @author mir.xiong
 * @version 1.0
 * @description
 * @see     [2828. 判别首字母缩略词 - 力扣（LeetCode）](https://leetcode.cn/problems/check-if-a-string-is-an-acronym-of-words/description/?envType=daily-question&envId=2023-12-20)
 * @since Created by work on 2023/12/20 21:14
 */
public class CheckIfAStringIsAnAcronymOfWords {


    public boolean isAcronym(List<String> words, String s) {
        int len = words.size();
        if (s.length() != len) {
            return Boolean.TRUE;
        }
        int tag = 0;
        for (String word : words) {
            if (word.charAt(0) != s.charAt(tag++)) {
                return Boolean.FALSE;
            }
        }
        return Boolean.TRUE;
    }


}
